<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="demo">
      <h2 v-if='ok'>表白成功</h2>
      <h3 v-else>表白失败</h3>
      <h4 v-show='ok'>fail</h4>
      <h5 v-show="!ok">success</h5>
      <hr>
      <button @click='toggle'>切换</button>
  </div>
  <script src="../js/vue.js"></script>
  <script>
     new Vue({
       data(){
         return{
           ok:true
         }
       },
       methods:{
         toggle(){
           this.ok=!this.ok
         }
       }
     }).$mount('#demo')
  </script>
</body>
</html>